<?php

include("system/core/sessions.class.php");
include("system/users/userAccess.class.php");
include("system/db/dbconnect.class.php");
include("system/display/navdisplay.class.php");
include("system/config/config.php");
include("system/cart/cart.class.php");
include("system/display/genericdisplay.class.php");
include("system/users/userController.class.php");

$sess = new Session();
$nav = new Navdisplay();
$user = new userAccess();
$user->isLoggedIn(1);
$CART = new Cart();
$genDisplay = new Genericdisplay();
$headerImage = $genDisplay->displayHeaderImage();
$account = new UserController();

if (isset($_POST['submit'])) {

	$account->editUser($_SESSION['username'], $_POST['password'], $_POST['verify']);

	unset($_POST);
	
}

if (isset($_POST['editadd'])) {

	$account->editAddress($_SESSION['username'], $_POST['addone'], $_POST['addtwo'], $_POST['city'], $_POST['postcode']);

	unset($_POST);

}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-16" />
		<meta name="description" content="" />
		<title>
			Your Account - Bartlett Mitchell Toolbox
		</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-16" />
<style type="text/css" media="screen">
/*<![CDATA[*/
 @import "styles/mainstyle.css"; 
/*]]>*/
</style>
<?php
        if (isset($_SESSION['lob'])){
        echo ("<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/".$lob.".css\" />");
        }
?>



<link href="styles/dropdown/dropdown.css" media="all" rel="stylesheet" type="text/css" />
<link href="styles/dropdown/dropdown.vertical.css" media="all" rel="stylesheet" type="text/css" />
<link href="styles/dropdown/themes/default/default.css" media="all" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery/jquery.js"></script>

<!--[if lt IE 7]>
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/jquery/jquery.dropdown.js"></script>
<![endif]-->

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="styles/ie.css" />
<![endif]-->

<script src="js/jquery.accordion-1.2.2.source.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	$(document).ready(function () {
		$('.accordion').accordion();
	});
</script>

</head>

<body>
<div id="wrapper">
	<div id="header">
	<div  id="homelink">
	
<a href="home.php">home</a>
<a href="contact.php">contact</a>
<a href="howtouse.php">how to use</a>

</div>
<div id="welcomeMessage">
<p>Welcome <?php echo $_SESSION['realname']; ?> <a href="logout.php">(logout)</a></p>
</div>

	
		<img src="images/<?php echo $headerImage; ?>" alt=""/>
	</div>
	
	<?php
	echo $CART->showMiniCart($_SESSION['username']);
	?>
	<div id="container">

		<?php
			echo $nav->buildNavigation();
		?>

		<div id="content">
			
			<?php
			
				$account->displayUser($_SESSION['username']);
			
			?>
			
		</div>

	</div>
	<div id="footer">
		<p>&copy; <?php echo (COPYRIGHT); ?> 2009</p>
	</div>
</div>

</body>
</html>